package com.company.beauty.dao;

import com.company.beauty.domain.mapper.BaseMapper;
import com.company.nuwa.common.domain.BasePage;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>基础service</p>
 * `
 *
 * @author Lionel Lee
 * @version 1.0: BaseService.java
 * @date 2021/5/4  11:39 星期二
 */

public abstract class AbstractBaseService<T, M extends BaseMapper, Long> {
    @Autowired
    public AbstractBaseDao<T, M> dao;

    public int insert(T record) {
        return dao.insert(record);
    }

    public int update(T record) {
        return dao.update(record);
    }

    public int deleteById(Long id) {
        return 0;
    }

    abstract T selectById(Long id) ;

    abstract List<T> selectByIdList(List<Long> idList);

    abstract <R extends BasePage> PageInfo<T> selectByPage(R request);


}
